/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/07/26
* File: OGLFBOTexture2D.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef OGLFBOTexture2D_h__
#define OGLFBOTexture2D_h__

#include "OGLTexture2D.h"
#include "../RenderView.h"

class OGLFBOTexture2D : public OGLTexture2D, public RenderView
{
public:
	OGLFBOTexture2D(const Dimension2Di& size);
	~OGLFBOTexture2D();

	void onAttached(FrameBuffer* fb, u32 att);
	void onDetached(FrameBuffer* fb, u32 att);

	void addRenderTargetListener(RenderTargetListener* listener);

protected:
	void createTextureEmpty();

protected:
	Dimension2Di				_size;
	std::string					_name;
	typedef						std::list<RenderTargetListener*> RenderTargetListeneList;
	RenderTargetListeneList		_render_target_listener_list;
};
#endif    /* OGLFBOTexture2D_h__ */